Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hint #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

daikikatsuragawa
Copy link

Signed-off-by: Daiki Katsuragawa 50144563+daikikatsuragawa@users.noreply.github.com

I read that the return type of _estimate_policy_gradient is not float but torch.Tensor (array-like).

I checked with mypy in an experiment.

mypy --ignore-missing-imports --disallow-untyped-def --warn-unreachable obp

Then the following error occurs.

obp/policy/offline_continuous.py:481: error: "float" has no attribute "mean"  [attr-defined]
obp/policy/offline_continuous.py:504: error: "float" has no attribute "mean"  [attr-defined]

This means that float is specified as the return type of _estimate_policy_gradient, but float has no method named mean.

Signed-off-by: Daiki Katsuragawa <50144563+daikikatsuragawa@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant